<template>
  <Modal
    :value.sync="batchMaintainModal"
    title="批量维护"
    @on-ok="handleMakeSure"
    @on-cancel="handleCloseModal"
  >
    <Card dis-hover>
      <RadioGroup v-model="radioValue" vertical>
        <Radio label="1">
          <span>基本信息模板 （根据SPU维护基本信息）</span>
        </Radio>
        <Radio label="2">
          <span>管理信息模板 （根据SPU维护管理信息）</span>
        </Radio>
        <Radio label="3">
          <span>SKU信息模板 （根据SKU维护包装信息）</span>
        </Radio>
        <Radio label="4">
          <span>供货信息模板 （供应商+供货区域+SKU维度）</span>
        </Radio>
        <Radio label="5">
          <span>供价信息模板 （供应商+供货区域+SKU维度）</span>
        </Radio>
        <Radio label="6">
          <span>供价信息模板--多计量 （供应商+供货区域+SKU维度）</span>
        </Radio>
        <Radio label="7">
          <span>售价信息模板 （销售区域+SKU维度）</span>
        </Radio>
        <Radio label="9">
          <span>验收标准 （SKU维度）</span>
        </Radio>
      </RadioGroup>
    </Card>
  </Modal>
</template>
<script>
export default {
  props: {
    visible: {
      type: Boolean,
      required: true
    }
  },
  data () {
    return {
      radioValue: '1',
      batchMaintainModal: this.visible
    }
  },
  watch: {
    visible (newVal) {
      this.batchMaintainModal = newVal
    }
  },
  methods: {
    handleMakeSure () {
      switch (this.radioValue) {
        case '1':// 基本信息新增
          this.$router.push({ name: 'basicsInfoManageList' })
          break;
        case '2':// 管理信息
          this.$router.push({ name: 'attInfoManageList' })
          break;
        case '3':// sku信息
          this.$router.push({ name: 'skuInfoManageList' })
          break;
        case '4':// 供货信息
          this.$router.push({ name: 'supplyInfoManageList' })
          break;
        case '5':// 进价信息
          this.$router.push({ name: 'bidInfoManageList' })
          break;
        case '6':// 进价信息多计量
          this.$router.push({ name: 'bidInfoManageList' })
          break;
        case '7':// 售价信息
          this.$router.push({ name: 'batchAddSalePrice' })
          break;
        case '9':// 批量新增验收标准
          this.$router.push({ name: 'batchAddAcceptanceStandard' })
          break;
      }
    },
    handleCloseModal () {
      this.radioValue = '1'
      this.batchMaintainModal = false
      this.$emit('update:visible', this.batchMaintainModal)
    }
  }
}
</script>
